<?php
class ContentAction extends Action
{
    public function index()
    {
        $id = $this->_get('id', null, 0);

        if ($id > 0) {
            $m = M('content');
            $item = $m->where('id=' . $id)->find();
            $this->assign('item', $item);
            fb($item);
            $m = M('channel');
            $channel = $m->where('id=' . $item['channel_id'])->find();
            if ($channel) {
                $tpl_path = TMPL_PATH . $channel['tpl_content_theme'] . '/' . $channel['tpl_content_path'];
                fb($tpl_path);
                $this->display($tpl_path);
            }
        }
    }
}